<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        String.prototype.Myrepeat = function(count)
        {
            let newStr = '';
            for(let i = 0;i<count;i++)
            {
                newStr+=this;
            }
            return newStr;
        }
        
        let str = 'a';
        console.log(str.Myrepeat(3))
        
        let str2 = 'aaa';
        console.log(str2.Myrepeat(3));
    </script>
</body>
</html>